package examination;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "AuditServlet", urlPatterns = { "/AuditServlet" })
public class AuditServlet extends HttpServlet
{
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        request.setCharacterEncoding("UTF-8");
        String examNo = request.getParameter("examNo");
        String audit = request.getParameter("audit");
        String refuseReason = request.getParameter("refuseReason");

        boolean isPass = "true".equals(audit);
        AuditBean.audit(examNo, isPass, refuseReason);

        response.sendRedirect("audit_list.jsp");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {

    }
}
